package com.sudo.service.admin.service;

import com.sudo.common.service.BaseService;
import com.sudo.dao.admin.model.vo.SysMemCpuVO;
import java.util.*;

/**
 * @author 为道日损 2020-04-25 23:45
 * webSite：https://www.sudo.ren
 */
public class AdminBaseService extends BaseService {

    public static final String cpuCode = "cpu.mhz";
    public static final String memCode = "mem.total";


    public static SysMemCpuVO map2MemCpu(Map<String ,Object> objectMap) {
        SysMemCpuVO sysMemCpuVO = new SysMemCpuVO();
        /*sysMemLog.setMemTotal(objectMap.get("memTotal").toString());
        sysMemLog.setMemUsed(objectMap.get("memUsed").toString());
        sysMemLog.setMemFree(objectMap.get("memFree").toString());
        sysMemLog.setMemFreePercent(objectMap.get("memFreePercent").toString());*/
        sysMemCpuVO.setC(Float.parseFloat(objectMap.get("cpuTotal").toString()));
        sysMemCpuVO.setM(Float.parseFloat(objectMap.get("memUsedPercent").toString()));
        sysMemCpuVO.setT(Long.parseLong(objectMap.get("now").toString()));
        return sysMemCpuVO;
    }
}
